﻿
/*
Author: liyonghelpme
Email: 233242872@qq.com
*/

/*
Author: liyonghelpme
Email: 233242872@qq.com
*/
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System;
using System.Linq;

namespace ChuMeng
{
	public class ObjectManager : MonoBehaviour
	{
		Dictionary<int, GameObject> fakeObjects = new Dictionary<int,GameObject> ();
		public static ObjectManager objectManager;
		public KBEngine.KBPlayer myPlayer;
		/*
		 * Player And Player Related GameObject
		 */ 
		public Dictionary<long, KBEngine.KBPlayer> Actors = new Dictionary<long, KBEngine.KBPlayer> ();
		List<KBEngine.KBNetworkView> photonViewList = new List<KBEngine.KBNetworkView> ();
		

		/// <summary>
		/// 获得玩家实体对象
		/// </summary>
		public KBEngine.KBNetworkView GetPhotonView (long viewID)
		{
			KBEngine.KBNetworkView result = null;
			foreach (KBEngine.KBNetworkView view in photonViewList) {
				if (view.GetServerID () == viewID && view.IsPlayer) {
					return view;
				}
			}
			return null;
		}

	}

}